﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfDataGridDropApp
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        ObservableCollection<Person> People = new ObservableCollection<Person>();

        public MainWindow()
        {
            InitializeComponent();
            People.Add(
                new Person()
                {
                    Id = 1,
                    Name = "丁一",
                    Desc = "1111"
                }
            );
            People.Add(
                new Person()
                {
                    Id = 2,
                    Name = "李二",
                    Desc = "222222"
                }
            );
            People.Add(
                new Person()
                {
                    Id = 3,
                    Name = "张三",
                    Desc = "333333"
                }
            );
            DG.ItemsSource = People;
        }
    }

    public class Person
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public string Desc { get; set; }
    }
}
